#!/bin/bash
echo "=== Testing pair? Built-in Function ==="
echo ""

echo "Testing pair? with various values:"
cat << 'EOF' | ./ascheme
;; Test with pairs (should return #t)
(pair? (cons 1 2))
(pair? (list 1 2 3))
(pair? '(a b c))
(pair? (list 'hello))

;; Test with non-pairs (should return #f)
(pair? '())
(pair? 42)
(pair? #t)
(pair? #f)
(pair? 'symbol)
(pair? "string")

;; Test with constructed values
(define x (cons 'a 'b))
(pair? x)

(define y (list))
(pair? y)

(define z (list 1 2 3))
(pair? z)
(pair? (cdr z))

;; Test with single element list
(define w (list 'single))
(pair? w)
(pair? (cdr w))

exit
EOF

echo ""
echo "pair? function testing completed!"